<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>新增体侧记录</title>
	<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no" name="viewport">
	<script src="js/flexible.js"></script>
	<link rel="stylesheet" href="css/reset.css">
	<link rel="stylesheet" href="css/homePage.css">
	<link rel="stylesheet" href="css/flexible.css">
	<link rel="stylesheet" href="css/bosscoach.css">
	<link rel="stylesheet" href="css/vant.css">
	<script src="js/jquery-3.3.1.min.js"></script>
	<script src="js/vue/vue.js"></script>
	<script src="js/vue/axios.js"></script>
	<script src="js/vue/MD5.js"></script>
	<script src="js/vue/vant.js"></script>

</head>
<body>
<div class="system_feedback" id="app">
	<template>
		<div class="supplementary_details">
			<div style="width: 50%" class="lf">
				<label class="labe">身&nbsp;&nbsp;高：</label>
				<input type="text" maxlength="3" oninput="this.value=this.value.replace(/[^\d.]/g,'')"  v-model="from.height" class="enter_mobile">
				<label>CM</label>
			</div>
			<div style="width: 50%" class="lf">
				<label class="labe">体&nbsp;&nbsp;&nbsp;重：</label>
				<input type="text" oninput="this.value=this.value.replace(/[^\d.]/g,'')" maxlength="3" v-model="from.weight" class="enter_mobile">
				<label>KG</label>
			</div>

			<div style="width: 50%" class="lf">
				<label class="labe">B&nbsp;M&nbsp;&nbsp;I：</label>
				<input type="text" oninput="this.value=this.value.replace(/[^\d.]/g,'')" maxlength="3" v-model="from.bmi" class="enter_mobile">
			</div>
			<div style="width: 50%" class="lf">
				<label class="labe">体&nbsp;&nbsp;&nbsp;脂：</label>
				<input type="text" oninput="this.value=this.value.replace(/[^\d.]/g,'')" maxlength="3" v-model="from.bodyfat" class="enter_mobile">
				<label>%</label>
			</div>
			
			<div style="width: 50%" class="lf">
				<label class="labe">臀&nbsp;&nbsp;&nbsp;围：</label>
				<input type="text" oninput="this.value=this.value.replace(/[^\d.]/g,'')" maxlength="3" v-model="from.hipline" class="enter_mobile">
				<label>CM</label>
			</div>
			<div style="width: 50%" class="lf">
				<label class="labe">胸&nbsp;&nbsp;&nbsp;围：</label>
				<input type="text" oninput="this.value=this.value.replace(/[^\d.]/g,'')" maxlength="3" v-model="from.bust" class="enter_mobile">
				<label>CM</label>
			</div>
					
			<div style="width: 50%" class="lf">
				<label class="labe">腰&nbsp;&nbsp;&nbsp;围：</label>
				<input type="text" oninput="this.value=this.value.replace(/[^\d.]/g,'')" maxlength="3" v-model="from.thewaist" class="enter_mobile">
				<label>CM</label>
			</div>
			<div style="width: 50%" class="lf">
				<label class="labe">肩&nbsp;&nbsp;&nbsp;宽：</label>
				<input type="text" oninput="this.value=this.value.replace(/[^\d.]/g,'')" maxlength="3" v-model="from.shoulder" class="enter_mobile">
				<label>CM</label>
			</div>
			<div style="width: 50%" class="lf">
				<label class="labe">小腿围：</label>
				<input type="text" oninput="this.value=this.value.replace(/[^\d.]/g,'')" maxlength="3" v-model="from.minthigh" class="enter_mobile">
				<label>CM</label>
			</div>
			<div style="width: 50%" class="lf">
				<label class="labe">大腿围：</label>
				<input type="text" oninput="this.value=this.value.replace(/[^\d.]/g,'')" maxlength="3" v-model="from.maxthigh" class="enter_mobile">
				<label>CM</label>
			</div>	
			<textarea v-model="from.info" id="personal_opinion" maxlength="100" placeholder="请输入备注信息"></textarea>
		</div>
	</template>
	<div class="submit_feedback" @click="saveList">提交</div>
</div>
<div class="technology clearfix">馆家提供技术支持</div>
</body>
<script>
new Vue({
    el: '#app',
    data: {
		from:{
			uid:"",
			height:"",
			weight:"",
			bmi:"",
			bodyfat:"",
			hipline:"",
			bust:"",
			thewaist:"",
			shoulder:"",
			minthigh:"",
			maxthigh:"",
			info:''
		}
    },
    created(){
        this.setCanS()
    },
    methods:{
		 //设置参数
		setCanS(){
            let Request = new Object()
            Request = GetRequest()
			this.from.uid = Request['uid']
        },
        saveList() {
			console.log(this.from)
			let from=JSON.stringify(this.from)
			let sign=md5(from)
			const params={
				from:from,
				sign:sign
			}
			getVs()
			axios.get('mobileapi/coach/user.php?act=add_test',{params:params}).then(data =>{
				console.log(data.data)
				let { msg, code,user} = data.data
					if (code !== 200) {
					    window.vant.Toast.fail(msg)
					} else {
						window.vant.Toast.success(msg)
						this.timer = setTimeout(this.list, 2000);
					}
				}).catch(function (error) {
					console.log(error); 
			})
		},
		list(){
			window.location.href='memberDetails.html?uid='+this.from.uid+''
		}
    }
})
</script>
</html>